package com.users.test;

import java.util.Comparator;

import com.users.bean.Users;

public class ComparatorUser implements Comparator{

	public int compare(Object arg0, Object arg1) {
		Users users1 = (Users) arg0;
		Users users2 = (Users) arg1;
		int flag = String.valueOf(users1.getuId()).compareTo(String.valueOf(users2.getuId()));
		if (flag == 0) {
			flag = users1.getUserName().compareTo(users2.getUserName());
		} 
		if (flag == 0) {
			flag = users1.getPassWord().compareTo(users2.getPassWord());
		} 
		return flag;
	}
}
